package com.lksy.web.listener;

import java.util.Timer;
import java.util.TimerTask;

import javax.servlet.ServletContext;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Component;
import org.springframework.web.context.ServletContextAware;

import com.lksy.core.print.Printer;


@Component
public class StartupListener implements InitializingBean, ServletContextAware {

	private ServletContext servletContext;
	
	@Override
	public void setServletContext(ServletContext servletContext) {
		this.servletContext = servletContext;
	}
	
	private void loadConfig() {
		  Timer timer = new Timer("loadConfig", true);
	        timer.schedule(new TimerTask() {
	            @Override
	            public void run() {
					Printer.info("站点信息初始化...");
	            }
	        }, 3 * 1000);
	}

	@Override
	public void afterPropertiesSet() throws Exception {
		loadConfig();
	}

}
